package com.huika.renrench.control.my.bank.activity;

import android.content.Intent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

import com.huika.renrench.R;
import com.huika.renrench.control.common.base.BaseAct;
import com.huika.renrench.control.my.bank.adapter.BankCardAdapter;
import com.huika.renrench.view.TitleBarHelper;

/**
 * 
 * @description：银行卡列表
 * @author zc
 * @date 2015年6月3日 下午3:58:26
 */
public class BankCardListActivity extends BaseAct implements OnItemClickListener {

	private ListView listview;
	private BankCardAdapter adapter;
	@Override
	public void setRootView() {
		setContentView(R.layout.activity_bank_card);
	}
	
	@Override
	protected void initData() {
		super.initData();
		TitleBarHelper barHelper = new TitleBarHelper(this, -1);
		barHelper.setLeftMsg("返回");
		barHelper.setTitleMsg("银行卡列表");
	}
	
	@Override
	protected void initWidget() {
		super.initWidget();
		listview = (ListView) findViewById(R.id.listview);
		
		adapter = new BankCardAdapter(this);
		listview.setAdapter(adapter);
		adapter.setGroup(BankInfoActivity.bankList);
		listview.setOnItemClickListener(this);
	}

	@Override
	public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
		Intent intent = new Intent();
		intent.putExtra("position", arg2);
		setResult(10000, intent);
		finish();
	}

}
